package domain;

import com.mchange.v2.c3p0.ComboPooledDataSource;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;

public class Test1 {
    public static void main(String[] args) throws SQLException {
        //1,导入jar包2，导入jdbc驱动
        //3,使用多态方式从datasource指向出C3P0提供的实现类combpolledDatasouree
        DataSource  ds=new ComboPooledDataSource();
        //4，通过getconnection从链接池获取链接对象
        Connection conn = ds.getConnection();
        System.out.println(conn);
    }
}
